package com.yanq.liancar.adapter;
/*
 *  @创建者     Administrator
 *  @创建时间   2018/11/16  10:55
 *  @描述       ${TODO}
 */


import android.os.Build;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yanq.liancar.R;
import com.yanq.liancar.bean.CarPinpaiBean;

import java.util.List;
import java.util.Random;

import de.hdodenhof.circleimageview.CircleImageView;

public class CarRelationAdapter extends BaseQuickAdapter<CarPinpaiBean.DataBean, BaseViewHolder> {
//    private Integer[] colors = {R.drawable.dian_green, R.drawable.dian_red, R.drawable.dian_blue, R.drawable.dian_yellow, R.drawable.dian_zong};

    public CarRelationAdapter(int layoutResId, @Nullable List<CarPinpaiBean.DataBean> data) {
        super(layoutResId, data);
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void convert(BaseViewHolder helper, CarPinpaiBean.DataBean item) {
        ImageView car_log=helper.getView(R.id.img_car_log);
        TextView textView2=helper.getView(R.id.brand_name);

        textView2.setText(item.getCar_trademark());
        Glide.with(mContext) .load(item.getImage_path()).into(car_log);
    }


}
